﻿<Window x:Class="OSBIDE.Controls.Views.SubmitAssignmentWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
             xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
        Title="Submit Assignment" Height="310" Width="277" ResizeMode="NoResize">
    <Grid Margin="10,10,10,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="67" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="3" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition />
            <RowDefinition Height="28" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="170*" />
            <ColumnDefinition Width="216*" />
        </Grid.ColumnDefinitions>

        <!-- 1st row -->
        <TextBlock Grid.Row="0" Grid.ColumnSpan="2" TextWrapping="Wrap" FontSize="14">You are about to submit an assignment.  Before continuing, please verify the following information:</TextBlock>

        <!-- 2nd row -->
        <TextBlock Grid.Row="1" Grid.Column="0" FontWeight="Bold">User:</TextBlock>
        <TextBlock Grid.Row="1" Grid.Column="1" x:Name="UserTextBlock" Text="{Binding Path=UserName, Mode=OneWay}" />

        <!-- 3rd row -->
        <TextBlock Grid.Row="2" Grid.Column="0" FontWeight="Bold">Course:</TextBlock>
        <ComboBox Grid.Row="2" Grid.Column="1" 
                  ItemsSource="{Binding Path=Courses}" 
                  SelectedValue="{Binding SelectedCourse, Mode=TwoWay}"
                  SelectedValuePath="Id"
                  DisplayMemberPath="Name"
                  />

        <!-- 5th row -->
        <TextBlock Grid.Row="4" Grid.Column="0" FontWeight="Bold">Assignment:</TextBlock>
        <ComboBox Grid.Row="4" Grid.Column="1" 
                  IsEnabled="{Binding Path=HasCourseSelected}" 
                  ItemsSource="{Binding Path=Assignments}" 
                  SelectedValue="{Binding SelectedAssignment, Mode=TwoWay}" 
                  SelectedValuePath="Id"
                  DisplayMemberPath="Name"
                  />

        <!-- 6th row -->
        <TextBlock Grid.Row="5" Grid.Column="0" FontWeight="Bold">Solution:</TextBlock>
        <TextBlock Grid.Row="5" Grid.Column="1" x:Name="SolutionNameTextBlock" Text="{Binding Path=SolutionName, Mode=OneWay}" TextWrapping="Wrap" />

        <!-- 7th row -->
        <TextBlock Grid.Row="6" Grid.Column="0" FontWeight="Bold">Last Submitted:</TextBlock>
        <TextBlock Grid.Row="6" Grid.Column="1" x:Name="LastSubmittedTextBlock" Text="{Binding Path=LastSubmitted, Mode=OneWay}" />


        <!-- 8th row -->
        <TextBlock 
            Grid.Row="7" 
            Grid.ColumnSpan="2" 
            x:Name="ServerMessage" 
            VerticalAlignment="Bottom" 
            HorizontalAlignment="Right"
            FontSize="14"
            Foreground="Red"
            TextWrapping="Wrap"
            Text="{Binding Path=ServerMessage}" 
            />
        
        <!-- 9th row -->
        <StackPanel 
            Grid.Row="8" 
            Grid.Column="1" 
            Grid.ColumnSpan="2"
            Orientation="Horizontal" 
            HorizontalAlignment="Right"
            Margin="0,5,0,0"
            >
            <wfi:WindowsFormsHost Margin="0,0,15,0" >
                <winForms:PictureBox x:Name="LoadingIcon" >
                </winForms:PictureBox>
            </wfi:WindowsFormsHost>
            <Button x:Name="OkayButton" 
                    Width="50" 
                    Margin="0,0,7,0"
                    Command="{Binding ContinueCommand}"
                    IsEnabled="{Binding Path=HasAssignmentSelected}"
                    CommandParameter="true"
                    >Submit</Button>
            <Button 
                x:Name="CancelButton" 
                Width="50"
                Command="{Binding CancelCommand}"
                CommandParameter="false"
                >Close</Button>
        </StackPanel>

    </Grid>
</Window>
